package com.ethan.cj.ssm.dao;

import com.ethan.cj.ssm.entity.CreditGranting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 授信机构 dao层接口
 */
@Mapper
@Repository
public interface CreditGrantingDao {

    /**
     * 查询全部机构信息
     * @return 机构集合
     */
    @Select("select * from `CreditGranting`")
    List<CreditGranting> selectCreditGranting();

    /**
     * 根据ID查询授信机构信息
     * @param cgid 查询条件
     * @return 授信机构对象
     */
    @Select("select * from `CreditGranting` where `cgid` = #{cgid}")
    CreditGranting selecteByCgid(@Param("cgid") int cgid);
}
